package com.sm.filemanagelibrary.util;

/**
 * created by zhud on 2019/9/27
 */
public class StringArraySort {
    /*如果first大于second，则返回true，否则返回false
     *
     */
    public static boolean isBiggerThan(String first, String second) {
        if (first == null || second == null || "".equals(first) || "".equals(second)) {
            System.out.println("字符串不能为空！");
            return false;
        }
        char[] arrayfirst = first.toCharArray();
        char[] arraysecond = second.toCharArray();
        int minSize = Math.min(arrayfirst.length, arraysecond.length);
        for (int i = 0; i < minSize; i++) {
            if ((int) arrayfirst[i] > (int) arraysecond[i]) {
                return true;
            } else if ((int) arrayfirst[i] < (int) arraysecond[i]) {
                return false;
            }
        }
        if (arrayfirst.length > arraysecond.length) {
            return true;
        } else {
            return false;
        }
    }
}
